#obtaining a filtered file with at least 3x coverage
!awk '{if ($8 >= 3) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_M1.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_M1.txt
#obtaining a filtered file with at least 3x coverage
!awk '{if ($8 >= 3) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_M3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_M3.txt
#obtaining a filtered file with at least 3x coverage
!awk '{if ($8 >= 3) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T1D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T1D3.txt
#obtaining a filtered file with at least 3x coverage
!awk '{if ($8 >= 3) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T1D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T1D5.txt
#obtaining a filtered file with at least 3x coverage
!awk '{if ($8 >= 3) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T3D3.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T3D3.txt
#obtaining a filtered file with at least 3x coverage
!awk '{if ($8 >= 3) print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/methratio_out_CG_T3D5.txt> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T3D5.txt
!cat /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_M1.txt /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_M3.txt /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T1D3.txt /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T1D5.txt /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T3D3.txt /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/methratio_out_CG3x_T3D5.txt > /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/3xCoverage_concatenated.txt
!head /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/3xCoverage_concatenated.txt
#Uploaded this file to SQLshare (saved as 3xCoverage_concatenated.txt) and kept all unique entries
!tr ',' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage.csv> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage.txt
!head /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage.txt
!awk '{print $1,$2,$2+1}' </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage.csv> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage_startend.csv
!tr ',' "\t" </Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage_startend.csv> /Volumes/web/Mollusk/bs_larvae_exp/AdapterTrimmed_FilteredFiles/3xCoverage/AllUniqueLoci_3xCoverage_final.txt
#NOTEBOOK NAME
nb='FilteringAdapterTrimmed_3xcoverage'
#NOTEBOOK LOCATION
nbloc='/Users/claireolson/Dropbox/Lab\ \(1\)/IPython_nbs/Claire/'
#TIMESTAMP
date=!date +%m%d_%H%M
#LOCATION OF POST DIRECTORY
post='/Volumes/web/Mollusk/iPython_Posts/'
cd {post}
!ipython nbconvert {nbloc}{nb} --to html --template full --output {nb}{date}